@ECHO OFF
SETLOCAL

:: Copy the CSV Workday export file for processing against Active Directory.
:: https://wdadsync.codeplex.com/
:: 2014.08.07

SET _source=\\<SERVER NAME>\<SHARE NAME>
SET _dest=C:\wdadsync\
SET _what=/COPY:DAT /MAXAGE:3
:: /COPYALL :: COPY ALL file info
:: /B :: copy files in Backup mode. 
:: /SEC :: copy files with SECurity
:: /MIR :: MIRror a directory tree
:: /MINAGE :: the MIN AGE to consider (needs to be older than...)
:: /MAXAGE :: the MAX AGE to consider (cannot be older than...)

SET _options=/R:0 /W:0 /LOG+:%_dest%Robocopy_Employee_Data.log /NJH /NFL /NDL
:: /R:n :: number of Retries
:: /W:n :: Wait time between retries
:: /LOG :: Output log file
:: /NFL :: No file logging
:: /NDL :: No dir logging
:: /NJH :: No Job Header.
:: /NJS :: No Job Summary.

:: If necessary, you may have to map drive to a DMZ.
:: net use \\<SERVER NAME>\<SHARE NAME> /user:<domain\username> <password>
 
ROBOCOPY %_source% %_dest% %_what% %_options% Employee_Data.csv

:: If drive was mappe above, delete after the data migration
:: net use \\<SERVER NAME>\<SHARE NAME> /delete